<?php
$queryStr =$this->shopHelper()->pagesQuery();
$params = $this->params ?? [];
?>
<?php if ($this->pageCount): ?>
    <div class="xm-pagenavi" style="padding: 0;">
        <?php if (isset($this->previous)): ?>
            <a href="javascript:;" onclick="dbshopAjaxList('<?php echo $this->url($this->route, $params, ['query'=>['page'=>$this->previous]]) . $queryStr; ?>', '<?php echo $this->showDivId;?>');"><span class="numbers first iconfont"></span></a>
        <?php else: ?>
            <span class="numbers first iconfont"></span>
        <?php endif; ?>

        <?php foreach ($this->pagesInRange as $page): ?>
            <?php if ($page != $this->current): ?>
                <a href="javascript:;" class="numbers current" onclick="dbshopAjaxList('<?php echo $this->url($this->route, $params, ['query'=>['page'=>$page]]) . $queryStr; ?>', '<?php echo $this->showDivId;?>');">
                    <?php echo $this->escapeHtml($page); ?>
                </a>
            <?php else: ?>
                <span class="numbers current">
                <?php echo $this->escapeHtml($page); ?>
            </span>
            <?php endif; ?>
        <?php endforeach; ?>

        <?php if (isset($this->next)): ?>
            <a href="javascript:;" onclick="dbshopAjaxList('<?php echo $this->url($this->route, $params, ['query'=>['page'=>$this->pageCount]]) . $queryStr; ?>', '<?php echo $this->showDivId;?>');"><span class="numbers last iconfont"></span></a>
        <?php else: ?>
            <span class="numbers last iconfont"></span>
        <?php endif; ?>
    </div>
<?php endif; ?>
